//package com.lis.scf.repository;
//
//import com.example.rbac.common.enums.CompanyType;
//import com.example.rbac.entity.Menu;
//import org.springframework.data.jpa.repository.JpaRepository;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.query.Param;
//import org.springframework.stereotype.Repository;
//
//
//@Repository
//public interface MenuRepository extends JpaRepository<Menu, Long> {
//
//    // 根据权限ID集合和企业类型查询菜单
//    @Query("SELECT m FROM Menu m WHERE m.permission.permissionId IN :permissionIds " +
//            "AND (m.companyType = :companyType OR m.companyType = 'ALL') " +
//            "AND m.isShow = true ORDER BY m.sortOrder ASC")
//    List<Menu> findByPermissionIdsAndCompanyType(
//            @Param("permissionIds") List<Long> permissionIds,
//            @Param("companyType") CompanyType companyType);
//
//    // 查询所有一级菜单
//    List<Menu> findByParentIdAndIsShowTrue(Long parentId);
//}
